<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script src="../dist/vue.js"></script>
    <div id="app">
        <input type="text" v-model="msg">
        <my v-model="title"></my>
    </div>
    <script>
        let vm = new Vue({
            el:'#app',
            data(){
                return {msg:'hello',title:'zf'}
            },
            components:{
                my:{
                    model:{
                        prop:'title',
                        event:'change'
                    },
                    props:{
                        title:String
                    },
                    methods:{
                        change(){
                            this.$emit('change','jw')
                        }
                    },
                    template:`<button @click="change">{{title}}</button>`
                }
            }
        })
    </script>
</body>
</html>